package com.fx.eduservice.controller;


import com.fx.commonuntils.ReturnMessage;
import com.fx.commonuntils.ReturnMessageUtils;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

import java.util.Map;

@Api(description = "登录管理系统")
@RestController
@RequestMapping("/eduservice/user")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Slf4j
@CrossOrigin//解决跨域问题
public class DduTeacherController {



    //登录接口
    @ApiOperation(value = "登录接口")
    @PostMapping ("/login")
    public ReturnMessage<Object> login() {
        Map<String, Object> dataMap = new HashMap<>();
        dataMap.put("token","admin");



        return ReturnMessageUtils.success(dataMap);
    }

    //info接口
    @ApiOperation(value = "info接口")
    @GetMapping ("/info")
    public ReturnMessage<Object> info() {
        Map<String, Object> dataMap = new HashMap<>();
        dataMap.put("roles","[admin]");
        dataMap.put("name","admin");
        dataMap.put("avatar","https://wpimg.wallstcn.com/ff8738c");



        return ReturnMessageUtils.success(dataMap);
    }







}
